package com.moyun.finance.controller;

import com.moyun.finance.entity.OrgCompany;
import com.moyun.finance.entity.Response;
import com.moyun.finance.service.OrgCompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;


@RestController
@RequestMapping("/org/company")
public class OrgCompanyController {
    @Autowired
    OrgCompanyService ods;

    //公司新增
    @RequestMapping("/save")
    public @ResponseBody Response save(@RequestBody OrgCompany company, HttpServletRequest request){
        Response res = ods.save(company, request);
        return res;
    }

    //修改公司信息
    @RequestMapping("/update")
    public @ResponseBody Response update(@RequestBody OrgCompany company){
        Response res = ods.update(company);
        return res;
    }

    //查询公司信息
    @RequestMapping("/find")
    public @ResponseBody Response update(String companyId){
        OrgCompany orgCompany = ods.find(companyId);
        return new Response("", orgCompany,true);
    }
}
